package xin.yangshuai.basic01.extend;

/**
 * Student
 *
 * @author shuai
 * @date 2023/1/13
 */
public class Student extends Person {

    private String name;

    public int age;

    @Override
    public void info() {
        System.out.println("Student 的 info");
        System.out.println("调用 Person 的 info");
        super.info();
    }

    @Override
    public void message() {
        System.out.println("Student 的 message");
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public void setName(String name) {
        this.name = name;
    }

//    @Override
//    public int getAge() {
//        return age;
//    }
//
//    @Override
//    public void setAge(int age) {
//        this.age = age;
//    }

    public String getSuperName() {
        return super.getName();
    }

    public void setSuperName(String name) {
        super.setName(name);
    }

    public int getSuperAge() {
        return super.getAge();
    }

    public void setSuperAge(int age) {
        super.setAge(age);
    }

    public static void main(String[] args) {
        Student student = new Student();
        student.info();

        student.setAge(12);
        student.setName("student");

        student.setSuperAge(24);
        student.setSuperName("person");

        System.out.println(student.getAge());
        System.out.println(student.getSuperAge());
        System.out.println(student.getName());
        System.out.println(student.getSuperName());

        System.out.println(student.age);
    }
}
